package com.junzhiit.nengji.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.bainaeco.framework.base.dao.AbstractBaseDAO;
import com.bainaeco.framework.common.jdbc.StatementParameter;
import com.bainaeco.framework.enums.IsDelete;
import com.junzhiit.nengji.dao.FreeConditionDAO;
import com.junzhiit.nengji.model.FreeCondition;

@Repository
public class FreeConditionDAOImpl extends AbstractBaseDAO<FreeCondition> implements FreeConditionDAO {

	@Override
	public List<FreeCondition> findAll(String postageTemplateId) {
		StringBuffer sql=new StringBuffer();
		StatementParameter param=new StatementParameter();
		
		sql.append("select * from free_condition where is_delete=? and postage_template_id=?");
		param.setInt(IsDelete.NO.toIntValue());
		param.setString(postageTemplateId);
		
		return queryForList(sql.toString(), FreeCondition.class, param);
	}

}
